#!/bin/bash

# For NVIDIA Jetson Module Camera test
#
# NOTE:
# Support Camera List:
# Sensing: SG2-IMX390C-5200-GMSL2-Hxxx

# Camera output format UYVY
CAM_FORMAT=UYVY

########################################################

function usage()
{
	echo -e "Usage: ./$(basename $0)\n"
}

########################################################

#export DISPLAY=:1

CAM_NUM=$(ls -l /dev/video* | wc -l)

echo "CAM_NUM=${CAM_NUM}"

for (( i = 0; i < ${CAM_NUM}; i++ )); do
	gst-launch-1.0 \
		v4l2src device=/dev/video${i} \
		! video/x-raw,format=${CAM_FORMAT},width=1920,height=1080 \
		! fpsdisplaysink video-sink=xvimagesink sync=false &
done
